const arr = [1,2,7]
Array.prototype._sort = function(cb) {
  for(let i = 0; i < arr.length; i++) {
    for(let j = 0; j < arr.length - i; j++) {
      const result =  cb(arr[j+1],arr[j])
      if(result < 0){
        const res = arr[j+1]
        arr[j+1] = arr[j]
        arr[j] = res 
      }
    }
  }
  return arr
}
arr._sort((a,b) => {
  return b - a
})
console.log(arr)

Array.prototype._concat = function() {
  const args = []
  for(let i = 0; i < arguments.length; i++){
    let val = arguments[i]
    if(val instanceof Array){
      args.push(...val)
    }else {
      args.push(val)
    }
  }
  const source = this.slice()
  for(let j = 0; j < args.length; j++){
    source.push(args[j])
  }
  return source
}